import com.yeepay.skb.biz.FeeSetPartsBuilder;
import com.yeepay.skb.results.FeeSetResult;
import com.yeepay.skb.util.Conts;

import java.io.IOException;

public class InitRate {
    public static void main(String[] args) throws IOException {
        String yeePayCode="10019038345";
        Double rate=0.0042d;
        FeeSetPartsBuilder builder=new FeeSetPartsBuilder();
        builder.setGroupCustomerNumber(Conts.customerNumber);
        builder.setCustomerNumber(yeePayCode);
        builder.setProductType("1");
        builder.setRate(rate.toString());
        FeeSetResult result=builder.exec(FeeSetResult.class);
        if (!result.imSuccess()) {
            System.out.println("1这个用户默认费率没设置不成功");
        }else {
            System.out.println(result.getCode());
        }
        builder=new FeeSetPartsBuilder();
        builder.setGroupCustomerNumber(Conts.customerNumber);
        builder.setCustomerNumber(yeePayCode);
        builder.setProductType("3");
        builder.setRate("2");
        result=builder.exec(FeeSetResult.class);
        if (!result.imSuccess()) {
            System.out.println("2这个用户默认费率没设置不成功");
        }else {
            System.out.println(result.getCode());
        }
        builder=new FeeSetPartsBuilder();
        builder.setGroupCustomerNumber(Conts.customerNumber);
        builder.setCustomerNumber(yeePayCode);
        builder.setProductType("4");
        builder.setRate("0");
        result=builder.exec(FeeSetResult.class);
        if (!result.imSuccess()) {
            System.out.println("4这个用户默认费率没设置不成功");
        }else {
            System.out.println(result.getCode());
        }
        builder=new FeeSetPartsBuilder();
        builder.setGroupCustomerNumber(Conts.customerNumber);
        builder.setCustomerNumber(yeePayCode);
        builder.setProductType("5");
        builder.setRate("0");
        result=builder.exec(FeeSetResult.class);
        if (!result.imSuccess()) {
            System.out.println("5这个用户默认费率没设置不成功");
        }else {
            System.out.println(result.getCode());
        }
    }
}
